import { connect } from 'dva';
import styles from './index.less';
import instock from 'images/instock@3x.png';
import unstock from 'images/unstock@3x.png';
import router from 'umi/router';
function App({ commodityDetails, dispatch }) {
    const stock = true;
    return (
        <div className={styles.normal}>
         <div className={styles.grayLine}></div>
            <div className={styles.commodityinfo}>
                <div className={styles.commodityPic}>
                    <img src={'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1540817373&di=bd64206fa8e60fb56a70ff05a3fc3f84&imgtype=jpg&er=1&src=http%3A%2F%2Fimg13.360buyimg.com%2Fn1%2Fs450x450_jfs%2Ft3367%2F331%2F1004605187%2F115176%2F8f333cbf%2F581af183Nb32b9429.jpg'} className={styles.iphonePic} /></div>
                <div>
                    <div className={styles.name}>iPhone 7 64G 银色</div>
                    <div className={styles.price}>￥3888元</div>
                    <div className={styles.opinion}>好评率：98%</div>
                    <div className={styles.helpCustomerButton}>
                        <div className={(stock) ? (styles.haveGoods) : (styles.noGoods)}><div onClick={()=>router.push('orderForGuestConfirm')}>代客下单</div></div>
                        {(stock) ? null : <div className={styles.searchShop}>查看有货门店</div>}
                    </div>
                </div>
                <img src={(stock) ? instock : unstock} className={styles.stockPic} />
            </div>
           
            <div className={styles.details}> 
            <div className={styles.grayLine}></div>
            <div className={styles.detailsTitle}>详细信息</div>
            </div>
        </div>
    );
}
export default connect(({ commodityDetails }) => ({ commodityDetails }))(App);
